/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.great.multimidia;

import java.awt.Graphics;
import java.awt.Image;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
import javax.swing.JSlider;
import javax.swing.plaf.basic.BasicSliderUI;
import net.coobird.thumbnailator.Thumbnails;

/**
 *
 * @author Drazzco
 */
 public class SliderKnob extends BasicSliderUI {

        Image knobImage;

        public SliderKnob( JSlider aSlider ) {

            super( aSlider );

            try {
                Thumbnails.of("SliderKnob.png").scale(4.0).toFile("SliderKnobResize.png");
                this.knobImage = ImageIO.read( new File("SliderKnobResize.png") );

            } catch ( IOException e ) {

                e.printStackTrace();
            }
        }
        public void paintThumb(Graphics g)  {        

            g.drawImage( this.knobImage, thumbRect.x, thumbRect.y, 8, 8, null );

        }

    }
